package com.gton.lpl.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;

import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;

import java.io.Serializable;
import java.util.Set;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 *
 * </p>
 *
 * @author GuoTong
 * @since 2021-10-17
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "GpMenu对象", description = "")
@AllArgsConstructor
@NoArgsConstructor
public class GpMenu implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键(菜单编号)")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty(value = "菜单名字")
    private String menuName;

    @ApiModelProperty(value = "级别（第几级菜单）")
    private Integer grade;

    @ApiModelProperty(value = "上级菜单ID")
    private Long topMenuId;

    @ApiModelProperty(value = "下级菜单ID")
    private Long nextMenuId;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "是否有效（1有效，0无效）")
    private Integer state;

    //上级菜单下所有的子菜单 自连接
    @TableField(exist = false)
    private Set<GpMenu> menus;


}
